package com.base;

import org.apache.commons.collections.FastArrayList;
import org.apache.commons.collections.FastHashMap;

import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author: sun.hongliang
 * @create: 2019/07/08 12:23
 */
public class HashMapTest {
    public static void main(String[] args) {
        HashMap<String, String> map = new HashMap();
        final String b = map.put("a", "bb");
        final String c = map.put("a", "cc");
        System.out.println(b);
        System.out.println(c);
        WeakHashMap<String, String> weakHashMap = new WeakHashMap<>();
        weakHashMap.put("a", null);
        weakHashMap.clear();

        Set<String> linkedSet = new LinkedHashSet<>();
        linkedSet.add("b");
        linkedSet.add("c");
        linkedSet.add("a");
        System.out.println(linkedSet);

        FastHashMap fastHashMap = new FastHashMap();
        fastHashMap.put("a", "b");
        fastHashMap.get("a");
        fastHashMap.size();

        FastArrayList fastArrayList = new FastArrayList();
        fastArrayList.add("a");
        fastArrayList.get(0);

        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put("a","b");

        ConcurrentHashMap concurrentHashMap = new ConcurrentHashMap();
        concurrentHashMap.put("a","a");
        concurrentHashMap.get("a");
        concurrentHashMap.remove("a");
    }
}
